package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)
import "ScriptServer/controllers"

func InitRouter() *gin.Engine  {
	router:= gin.Default()

	//v1 router
	v1:= router.Group("v1")
	v1.POST("/login",controllers.Login)
	ver := v1.Group("app")
	ver.Use(authValid())
	{
		ver.POST("/checkNewVer", controllers.CheckNewVer)
		ver.StaticFS("/getNewVer", http.Dir(`C:\Users\Administrator\go\src\ScriptServer\test\`))
	}
	return router
}